// 拼接HTTPUrl
/*function url(path) {
  return '/local/' + path;
}*/

function url(pathname) {
  return window.RPConfig['local'] + pathname;
}

const todoListAPI = {
  //已办待办列表查询接口//bpmn/flowable/todo/page
  querylist: params => {
    return $http.post(url('/bpmn/flowable/todo/page'), params).then(res => res.data);
  },

  //POST流程审批历史记录：/bpmn/flowable/process/comment/list
  processlist: params => {
    return $http.post(url('/bpmn/flowable/process/comment/list'), params).then(res => res.data);
  },

  //POST查询申请历史://bpmn/flowable/application/flowable
  processFlowable: params => {
    return $http.post(url('/bpmn/flowable/application/flowable'), params).then(res => res.data);
  },

  //POST查询流程实例最新的节点id和任务处理人://bpmn/flowable/process/current/node
  processNode: params => {
    return $http.post(url('/bpmn/flowable/process/current/node'), params).then(res => res.data);
  },
  //POST流程图片://bpmn/flowable/process/image
  processImage: params => {
    return $http.post(url('/bpmn/flowable/process/image'), params).then(res => res.data);
  },
  //退回重新提交流程://bpmn/flowable/process/submit
  processSubmit: params => {
    return $http.post(url('/bpmn/flowable/process/submit'), params).then(res => res.data);
  },

  //POST流程节点通过:///bpmn/flowable/process/task/pass
  processPass: params => {
    return $http.post(url('/bpmn/flowable/process/task/pass'), params).then(res => res.data);
  },

  //POST回退指定节点://bpmn/flowable/process/task/reject
  processReject: params => {
    return $http.post(url('/bpmn/flowable/process/task/reject'), params).then(res => res.data);
  },

  //POST查询可以退回的流程节点://bpmn/flowable/process/task/reject/node/list
  processRejectNode: params => {
    return $http.post(url('/bpmn/flowable/process/task/reject/node/list'), params).then(res => res.data);
  },

  //撤回流程://bpmn/flowable/process/undo
  processUndo: params => {
    return $http.post(url('/bpmn/flowable/process/undo'), params).then(res => res.data);
  },

  //POST判断能否撤回流程://bpmn/flowable/process/undo/check
  processUndoCheck: params => {
    return $http.post(url('/bpmn/flowable/process/undo/check'), params).then(res => res.data);
  },
}
export default todoListAPI
